package com.zxbg.service.impl.proportalServiceImpl;

import com.zxbg.dao.AppCategoryDao;
import com.zxbg.dao.AppDao;
import com.zxbg.domain.App;
import com.zxbg.domain.AppCategory;
import com.zxbg.service.proportalService.AppCenterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AppCenterServiceImpl implements AppCenterService {
    @Autowired
    AppDao appDao;
    @Autowired
    AppCategoryDao appCategoryDao;

    @Override
    public List<App> getAllApps(Integer tenant_id) {
        return appDao.getAllApps(tenant_id);
    }

    @Override
    public boolean updateApp(App app) {
        return appDao.updateApp(app) > 0;
    }

    @Override
    public List<AppCategory> getActiveCategory(Integer tenant_id) {
        return appCategoryDao.getActiveCategory(tenant_id);
    }
}
